//
//  LoadingTableViewCell.m
//  QiuBaiDemo
//
//  Created by lanouhn on 15/5/13.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "LoadingTableViewCell.h"
#import "FirstModel.h"
@interface LoadingTableViewCell ()
@property (nonatomic ,retain)UIActivityIndicatorView *indicator;//风火轮
@property (nonatomic ,retain)UILabel *loadingLable;//正在载入

@end
@implementation LoadingTableViewCell
- (void)dealloc{
    [_indicator release];
    [_loadingLable release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
//        [self.contentView addSubview:self.indicator];
        //[self.contentView addSubview:self.loadingLable];
    }
    return self;
}
- (UILabel *)loadingLable{
    if (!_loadingLable) {
        self.loadingLable = [[[UILabel alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 40)] autorelease];
        _loadingLable.textAlignment = NSTextAlignmentCenter;
        _loadingLable.font = [UIFont systemFontOfSize:15];
        FirstModel *model = [[FirstModel alloc]init];
//        NSString *str = model.created_at;
        _loadingLable.text =[NSString stringWithFormat:@"正在载入...."];
        _loadingLable.textColor = [UIColor grayColor];
        [model release];
    }
    return _loadingLable;
}
- (UIActivityIndicatorView *)indicator{
    if ( !_indicator) {
        self.indicator = [[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyleGray)]autorelease];
        _indicator.frame = CGRectMake(130, 18, 0, 0);
    }
    return _indicator;
}
- (void)startLoading{
    [self.indicator startAnimating];//让风火轮开始转动
}

@end
